home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
comm
/
thor
/
thor24arexx.lha
/
HTMLThor.thor
< prev
next >
Wrap
Text File
|
1996-11-11
|
6KB
|
190 lines
/*
** Filename: HTMLThor.thor
**
** $VER: v1.31 (09.22.96)
**
** Author: Troy E. Bouchard
**
** EMail: tbouchar@ptialaska.net
** Webpage: http://www.ptialaska.net/~tbouchar
**
*/
/* Find our Thor Port and number! */
p = ' '||Address() || ' ' || show('P',,)
ThorPort = pos(' THOR.',p)
if ThorPort > 0 then ThorPort = word(substr(p,ThorPort+1),1)
else
do
say "Can't seem to find the Thor port!"
exit 10
End
/* Load the BBSRead library up! */
if ~show('p', 'BBSREAD') then
do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
End
/* change these to match your system! */
TB_WWW = 'A HREF="digest/'
TB_EMail = 'A HREF="mailto:'
TB_MSGPATH = 'T:'
EXT = '.html' /* change this to .htm if you need to. */
/* aint ARexx just great? */
TB_WDAYS = 'Monday Tuesday Wednesday Thursday Friday Saturday Sunday'
TB_MONTH = 'January February March April May June July August September October November December'
options results
Call GetPages
Exit
GetPages:
Address BBSREAD
'GETBBSLIST stem "'BBSLIST'"'
if(rc ~=0) then
do
Address(ThorPort)
'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"'
exit
End
Address(ThorPort)
'REQUESTLIST instem "'BBSLIST'" outstem "'TB_SYSTEM'" title "Selection:" DRAGSELECT MULTISELECT SIZEGADGET'
if(rc ~= 0) then exit
do i=1 to TB_SYSTEM.COUNT
Address BBSREAD
'GETCONFLIST "'TB_SYSTEM.i'" CONFLIST'
if(rc ~= 0) then
do
Address(ThorPort)
'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"'
exit
End
Address(ThorPort)
'REQUESTLIST instem "'CONFLIST'" title "Select conference on ' || TB_SYSTEM.i || ":" ||'" SIZEGADGET'
if(rc ~= 0) then TB_CONFNAME = ""
else TB_CONFNAME = result
MyConf = Translate(TB_CONFNAME,," ","_")
call open(out, TB_MSGPATH||MyConf||EXT, w)
call writeln(out, "<HTML><HEAD><TITLE>"MyConf||"</TITLE></HEAD>")
call writeln(out, "<BODY><HR><CENTER><H2>"MyConf"</H2><HR>")
call close(out)
Address BBSREAD
'GETCONFDATA BBSName "'TB_SYSTEM.i'" ConfName "'TB_CONFNAME'" Stem CDATA'
if(rc ~= 0) then
do
Address(ThorPort)
'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"'
exit
End
Address(ThorPort)
'OPENPROGRESS TITLE " HTMLThor v1.31" PT "Getting Pages..." AT "_Abort" PCW 30'
if(rc ~= 0) then
do
'CLOSEPROGRESS REQ' win
'REQUESTNOTIFY TEXT "'THOR.LASTERROR'" BT "_OK"'
exit
end
win = result
do j = CDATA.FIRSTMSG to CDATA.LASTMSG
Address(ThorPort)
msgtext = 'Saving Page 'j' of 'CDATA.LASTMSG' to 'TB_MSGPATH||MyConf||j||EXT
'UPDATEPROGRESS REQ "'win'" TOTAL "'CDATA.LASTMSG'" CURRENT "'j'" PT "'msgtext'"'
if(rc ~= 0) then do
'CLOSEPROGRESS REQ' win
win=0
leave
end
Drop HeaderInfo.
Drop TextInfo.
Address BBSREAD
'READBRMESSAGE "'TB_SYSTEM.i'" "'TB_CONFNAME'" MSGNR "'j'" TextStem "'TextInfo'" HeadStem "'HeaderInfo'" DataStem "'MsgData'"'
if(rc ~= 0) then
do
Address(ThorPort)
'CLOSEPROGRESS REQ' win
'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"'
Exit
end
if ~bittst(MsgData.FLAGS, 5) then do
'AMIGA2DATE "'HeaderInfo.CREATIONDATE'" Stem "'Time'"'
if(rc ~= 0) then
do
Address(ThorPort)
'CLOSEPROGRESS REQ' win
'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"'
Exit
end
if(Time.WDAY == '0') then
WKDays = 'Sunday'
else
WKDays = word(TB_WDAYS, Time.WDAY)
MODays = word(TB_MONTH, Time.MONTH)
if symbol('HeaderInfo.FROMADDR') = "VAR" then
Addr = '<'TB_EMail || value('HeaderInfo.FROMADDR') || '">'
if symbol('HeaderInfo.FROMNAME') = "VAR" then
Name = value('HeaderInfo.FROMNAME') || '</A>'
if symbol('HeaderInfo.SUBJECT') = "VAR" then
Subj = value('HeaderInfo.SUBJECT')
call open(out, TB_MSGPATH||MyConf||EXT, a)
call writeln(out,'<B>From:</B>'Addr||Name'<BR><B>Subject:</B><'TB_WWW||MyConf||j||EXT'">'Subj||'.'||'</A><P>')
call close(out)
anterior=j-1
proxima=j+1
if anterior=0 then anterior=1
call open(out, TB_MSGPATH || MyConf || j || EXT, w)
call writeln(out, '<HTML><HEAD><TITLE>'MyConf||' - 'Subj||'</TITLE></HEAD>')
call writeln(out, '<BODY><H2><B><CENTER>'MyConf||'</H2>')
call writeln(out, 'Message created on:<BR>'WKDays', 'MODays' 'Time.MDAY', 'Time.YEAR'</B>')
call writeln(out, '<HR><B>From:</B>'Addr||Name' ('HeaderInfo.FROMADDR')<BR><B>Subject:</B> 'Subj||'</CENTER>')
call writeln(out, '<HR><CENTER>|<A HREF="'MyConf||anterior||EXT'">Previous Message</A> | <A HREF="'MyConf||proxima||EXT'">Next Message</A> | </CENTER>')
call close(out)
cnt = value('TextInfo.TEXT.COUNT')
call open(out, TB_MSGPATH||MyConf||j||EXT, a)
call writeln(out, '<HR><H4>')
do n = 1 to cnt
call writeln(out, value('TextInfo.TEXT.n')'<BR>')
end
call writeln(out,'</H4><HR><CENTER> | <A HREF="'MyConf||anterior||EXT'">Previous Message</A> | <A HREF="'MyConf||proxima||EXT'">Next Message</A> | <HR>')
call writeln(out,'<B>Output created by HTMLThor v1.31<BR>')
call writeln(out,'Written by: Troy E. Bouchard, © 1996</CENTER></B>')
call writeln(out,"<HR></BODY></HTML>")
call close(out)
end
end
call open(out, TB_MSGPATH||MyConf||EXT, a)
call writeln(out,"</BODY></HTML></CENTER>")
call close(out)
end
Address(ThorPort)
'REQUESTNOTIFY TEXT " We Are Done!\nHTML Files Copied!" BT "_Cool!"'
'CLOSEPROGRESS REQ' win
Return